import { plugin, Super, BotApi } from '../../model/api/gameapi.js'
export class assGetHelp extends plugin {
    constructor() {
        super(Super({
            rule: [
                {
                    reg: '^#宗门(帮助|菜单|help|列表)$',
                    fnc: 'assHelpImg'
                },
                {
                    reg: '^#宗门管理$',
                    fnc: 'assHelpAdmin'
                }
            ]
        }))
    }
    assHelpImg = async (e) => {
        const data = await BotApi.ImgHelp.getboxhelp({ name: 'help' })
        if (!data) {
            return
        }
        const isreply = await e.reply(await BotApi.ImgCache.helpcache({ i: 1, data }))
        await BotApi.User.surveySet({ e, isreply })
        return
    }
    assHelpAdmin = async (e) => {
        const data = await BotApi.ImgHelp.getboxhelp({ name: 'admin' })
        if (!data) {
            return
        }
        const isreply = await e.reply(await BotApi.ImgCache.helpcache({ i: 0, data }))
        await BotApi.User.surveySet({ e, isreply })
        return
    }
}
